<div class="table-body">
    <table id="balanceTable" lay-filter="balanceTable"></table>
</div>
<script>
    layui.use(['table',], function () {
        var table = layui.table; //表格
        var tableIn = table.render({
            elem: '#balanceTable',
            height: 'full-99',
            cellMinWidth: '80',
            totalRow: true,
            method: 'post',
            url: "{:url('balance/lssFundLog')}",
            toolbar: '#toolbar', //开启头部工具栏，并为其绑定左侧模板
            defaultToolbar: ['filter', 'exports'],
            id: 'balanceTable',
            cols: [[
                { type: 'numbers'},
                { field: 'clientName',  align: 'left', title: 'clientName',width:240},
                { field: 'amount', title: 'amount', align:"right",width:150,
                    templet: function (d) {
                        var amount = d.amount;
                        var color  = 'color:red';
                        if(amount > 0){
                            color = '';
                        }
                        return "<span style='font-weight:bold;" + color + "'>" + amount +"</span>";
                    },
                    totalRow: true},
                { field: 'availableBalance', title: 'availableBalance', align:"right",width:150,
                    style:'font-weight:bold'},
                { field: 'date',  align: 'left', title: 'date',width: 170},
                { field: 'mid',  align: 'left', title: 'mid'},
                { field: 'type',  align: 'left', title: 'Type'},
                { field: 'date_real',align: 'center', title: 'webhooks时间记录' ,
                    templet: function (d) {
                        var date_real = d.date_real;
                        if(date_real == null){
                            return ' -- ';
                        }else{
                            return date_real;
                        }
                    }
                }
            ]],
            page: true,
            limit: 20,
            limits: [20,  100 , 500 ]
        });
    });
</script>